﻿using System;

namespace Kugar.Tool.RemoteEventBus.Triggers
{
    public interface IAsyncEventTrigger<in T>:IEventTrigger //where T : EventArgs
    {
        IRemoteEventBus EventBus { get; }

        string EventName { get; }

        /// <summary>
        /// 触发异步事件,并返回事件ID,用于后续跟踪
        /// </summary>
        /// <param name="eventArgs"></param>
        /// <returns></returns>
        string Trigger(T eventArgs);

        /// <summary>
        /// 触发事件并发送给指定ID的订阅者,该功能用于补发事件
        /// </summary>
        /// <param name="eventArgs"></param>
        /// <param name="clientID"></param>
        /// <returns></returns>
        string TriggerToClientID(string clientID, T eventArgs);

    }
}